﻿using System;
using System.Collections;

namespace TCL.FUNC
{
    public class ConstEx
    {
        public class connectionStrings
        {
            public const String connMSSql_DF = "connMSSql_DF";
            public const String connMSSql_API = "connMSSql_API";
            public const String connMSSql_HD = "connMSSql_HD";
            public const String connMSSql_PII = "connMSSql_PII";
            public const String connMSSql_FB = "connMSSql_FB";
            public const String connMSSql_OSM = "connMSSql_OSM";

            //public const String connSqLite_DF = "connSqLite_DF";
            public const String connSqLite_API = "connSqLite_API";
            public const String connSqLite_LOG = "connSqLite_LOG";
            public const String connSqLite_FB = "connSqLite_FB";

            //public const String connOracle = "connOracle";
            //public const String connMSAccess = "connMSAccess";
            //public const String connMySql = "connMySql";
        }

        public class QuerySqlite
        {
            public const String Log_CreateTable = "CREATE TABLE IF NOT EXISTS {0} ( " +
                                                        "iLogID       INTEGER  PRIMARY KEY AUTOINCREMENT, " +
                                                        "sContent     TEXT, " +
                                                        "sUrl         TEXT, " +
                                                        "sUrlRef      TEXT, " +
                                                        "sIP          TEXT, " +
                                                        "sDatabase    TEXT, " +
                                                        "iType        INTEGER, " +
                                                        "dProcessTime NUMERIC, " +
                                                        "tTimeBegin   DATETIME, " +
                                                        "tTimeEnd     DATETIME, " +
                                                        "bStatus      BOOLEAN  " +
                                                    ");";

            public const String Database_ResetAutoincrement_Table = "DELETE FROM sqlite_sequence " +
                                                    "WHERE name ='{0}'; ";
                                                       //"VACUUM;";

            public const String Database_Split_Table = "CREATE TABLE {0} AS SELECT * FROM {1}; " +
                                                    "DELETE FROM {2}; ";
                                                    //"VACUUM;";

            public const String Database_SelectAllTableName = "SELECT name AS 'Value' " +
                                                    "FROM sqlite_master " +
                                                    "WHERE (type='table' AND name NOT LIKE 'sqlite_sequence');";



            public const String Log_InsertItem = "INSERT INTO tblLog (sContent, sUrl, sUrlRef, sIP, sDatabase, iType, dProcessTime, bStatus, tTimeBegin, tTimeEnd) " +
                                                    "VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', {5}, {6}, {7}, '{8}', '{9}');" +
                                                    "SELECT COUNT(iLogID) FROM tblLog;";

            public const String LogAll_InsertItem_When_MaxSize = "INSERT INTO {0} " +
                                                    "SELECT * FROM {1}; " +
                                                    "DELETE FROM {2}; ";
                                                    //"VACUUM;";

            public const String LogOther_InsertItem = "INSERT INTO tblLogOther (sContent, sUrl, sUrlRef, sIP, sDatabase, iType, dProcessTime, bStatus, tTimeBegin, tTimeEnd) " +
                                                    "VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', {5}, {6}, {7}, '{8}', '{9}');";

            public const String Log_SelectBy_TableName = "SELECT * " +
                                                    "FROM {0};";

            public const String Log_DropTable = "DROP TABLE {0}; ";
                                                       //"VACUUM;";

            public const String Log_DeleteDataTable = "DELETE FROM {0}; ";
                                                       //"VACUUM;";


        }

        public class Log_iType
        {
            public const Int16 GMDD_ZINGME = 100;
            public const Int16 GMDD_ZINGME_OK = 101;
            public const Int16 GMDD_ZINGME_NOT_FOUND = 102;
            public const Int16 GMDD_ZINGME_ERROR = 103;

            public const Int16 KARAOKE = 700;
            public const Int16 KARAOKE_OK = 701;
            public const Int16 KARAOKE_NOT_FOUND = 702;
            public const Int16 KARAOKE_ERROR = 703;
            public const Int16 KARAOKE_ACCESS_DENIAL = 704;



            public const Int16 WEDDING = 200;
            public const Int16 WEDDING_OK = 201;
            public const Int16 WEDDING_NOT_FOUND = 202;
            public const Int16 WEDDING_ERROR = 203;

            public const Int16 ACCOUNT = 300;
            public const Int16 ACCOUNT_LOGIN = 301;
            public const Int16 ACCOUNT_NOT_FOUND = 302;
            public const Int16 ACCOUNT_ERROR = 303;
            public const Int16 ACCOUNT_RESET_PW = 304;
            public const Int16 ACCOUNT_ACCESS_DENIAL = 305;
            public const Int16 ACCOUNT_VERIFY = 306;
            public const Int16 ACCOUNT_REG_NEWLETTER = 307;
            public const Int16 ACCOUNT_REG_QA = 308;

            public const Int16 EMAIL = 400;
            public const Int16 EMAIL_REG = 401;
            public const Int16 EMAIL_BIRTHDAY = 402;
            public const Int16 EMAIL_1 = 403;
            public const Int16 EMAIL_2 = 404;

            public const Int16 EXCEPTION = 500;

            public const Int16 PAGE_NOT_FOUND = 600;

            public const Int16 DATABASE = 900;
            public const Int16 DATABASE_SELECT = 901;
            public const Int16 DATABASE_INSERT_UPDATE_DELETE = 902;
            public const Int16 DATABASE_OTHER = 903;
            public const Int16 DATABASE_INSERT_UPDATE_DELETE_FAIL = 904;
        }

        public class Token_iType_C
        {
            public const Int16 ResetPassword = 1;
            public const Int16 UnRegNewLetter = 2;
            public const Int16 UnNotificationQA = 3;
            public const Int16 VerifyAccount = 4;
            public const Int16 Test = 9;
        }

        public class Log_iType_NameFile_DateTime_C
        {
            /// <summary>
            /// Default: 0
            /// </summary>
            public const Int16 Default = 0;

            /// <summary>
            /// Năm: 1
            /// </summary>
            public const Int16 Year = 1;

            /// <summary>
            /// Quý: 2
            /// </summary>
            public const Int16 Quarter = 2;

            /// <summary>
            /// Tháng: 3
            /// </summary>
            public const Int16 Month = 3;

            /// <summary>
            /// Tuần: 4
            /// </summary>
            public const Int16 Week = 4;

            /// <summary>
            /// Ngày: 5
            /// </summary>
            public const Int16 Day = 5;

            /// <summary>
            /// Giờ: 6
            /// </summary>
            public const Int16 Hour = 6;

            /// <summary>
            /// Phút: 7
            /// </summary>
            public const Int16 Minute = 7;

            /// <summary>
            /// Giây: 8
            /// </summary>
            public const Int16 Second = 8;

            /// <summary>
            /// Mili giây: 9
            /// </summary>
            public const Int16 MiliSecond = 9;
        }

        public class UrlEX_C
        {
            public const string Trang = "trang-";
            public const string _Trang = "/trang-";
        }

        public class Insert_Update_Delete
        {
            public const Int16 Insert = 1;
            public const Int16 Insert_11 = 11;
            public const Int16 Insert_12 = 12;
            public const Int16 Insert_13 = 13;
            public const Int16 Insert_14 = 14;
            public const Int16 Insert_15 = 15;
            public const Int16 Insert_Update = 19;

            public const Int16 Update = 2;
            public const Int16 Update_21 = 21;
            public const Int16 Update_22 = 22;
            public const Int16 Update_23 = 23;
            public const Int16 Update_24 = 24;
            public const Int16 Update_25 = 25;

            public const Int16 Delete = 3;
            public const Int16 Delete_31 = 31;
            public const Int16 Delete_32 = 32;
            public const Int16 Delete_33 = 33;
            public const Int16 Delete_34 = 34;
            public const Int16 Delete_35 = 35;
        }

        public class Server_Mail
        {
            public const String gmail = "@gmail.com";
            public const String gmail1 = "@gmail.com";
        }

        public class appSetting_State
        {
            public const String Close = "0";
            public const String Open = "1";
            public const String Default = "9";
        }



        public class TableID_C
        {
            public const Int16 Default = 0;
            public const Int16 Category = 1;
            public const Int16 Topic = 2;
            public const Int16 Media = 3;
            public const Int16 QuestionAnswer = 4;
            public const Int16 Answer = 44;
            public const Int16 Account = 5;
            public const Int16 File = 6;
            public const Int16 Quiz = 7;
            public const Int16 Other = 9;

            public const Int16 Function = 20;
            public const Int16 Sitemap = 21;
            public const Int16 Temp = 22;
            public const Int16 Database = 23;
            public const Int16 Tag = 24;
            public const Int16 Error = 25;
            public const Int16 EditSourceFile = 26;
            public const Int16 Group = 27;
            public const Int16 BackLink = 28;
            public const Int16 Advertise = 29;
            public const Int16 MetaTag = 30;
            public const Int16 NewsLetter = 31;
            public const Int16 Permission = 32;
            public const Int16 TSQL = 33;
            public const Int16 SEO = 34;

            public const Int16 Tool = 99;
        }

        public class Table_Name_C
        {
            public const string Account = "[Tài khoản]";
            public const string Category = "[Danh mục]";
            public const string Database = "[Cơ sở dữ liệu SQL Server]";
            public const string Topic = "[Bài viết]";
            public const string Media = "[Giải trí]";
            public const string Tag = "[Nhãn]";
            public const string File = "[Chia sẻ File]";
            public const string QuestionAnswer = "[Hỏi - Đáp]";
            public const string Error = "[Lỗi hệ thống]";
            public const string EditSourceFile = "[Chỉnh sửa file]";
            public const string Group = "[Nhóm bài viết]";
            public const string BackLink = "[Liên kết link]";
            public const string Advertise = "[Quảng cáo]";
            public const string Sitemap = "[Bản đồ website]";
            public const string MetaTag = "[Thẻ SEO]";
            public const string NewsLetter = "[Đăng ký nhận tin]";
            public const string Function = "[Chức năng hệ thống]";
            public const string Permission = "[Phân quyền cho người dùng]";
            public const string TSQL = "[Truy vấn Database SQL Server]";
            public const string SEO = "[Tối ưu công cụ tìm kiếm - SEO]";
            public const string Quiz = "[Thi trắc nghiệm - Đố]";
            public const string Wedding = "[Khách mời]";
            public const string Url_Change = "[Thay đổi đường dẫn]";

            public const string Default = "Default";
        }

        //public class funcButtonToolBar
        //{
        //    public const Int16 MAIN = 0;
        //    public const Int16 INSERT_LIST = 1;
        //    public const Int16 INSERT_ITEM = 2;
        //    public const Int16 UPDATE_ITEM = 3;
        //    public const Int16 DELETE_LIST = 4;
        //    public const Int16 DELETE_ITEM = 5;
        //    public const Int16 REFRESH_LIST = 6;
        //    public const Int16 EXPORT_EXCEL = 7;
        //    public const Int16 RESET_FORM = 8;
        //    public const Int16 PREVIEW_TOPIC = 9;
        //    public const Int16 BACK_LIST = 10;

        //    public const Int16 LIST = 11;
        //    public const Int16 DETAIL = 12;
        //    public const Int16 INSERT = 13;
        //    public const Int16 VIEWFILE = 14;
        //    public const Int16 NA = 15;
        //    public const Int16 OTHER = 16;
        //}

        //public class FunctionType
        //{
        //    public const Int16 Default = 0;
        //    public const Int16 Insert = 1;
        //    public const Int16 Update = 2;
        //    public const Int16 Delete = 3;
        //    public const Int16 View = 4;
        //    public const Int16 InsertNew = 5;
        //    public const Int16 InsertComment = 6;
        //}

        public class FunctionSetMsg
        {
            public const Int16 ERROR = 0;
            public const Int16 SUCCESS = 1;
            public const Int16 INFO = 2;
            public const Int16 WARNING = 3;
            public const Int16 DANGER = 4;
        }

        public enum FunctionSetMsgEx
        {
            ERROR = 0,
            SUCCESS = 1,
            INFO = 2,
            WARNING = 3,
            DANGER = 4
        }




        public class FunctionNew
        {
            public const Int16 LIST = 10;
            public const Int16 ListRefresh = 11;
            public const Int16 ListInsert = 12;
            public const Int16 ListDelete = 13;
            public const Int16 ListExport = 14;
            public const Int16 ListImport = 15;

            public const Int16 DETAIL_I = 20;
            public const Int16 DetailInsert = 21;
            public const Int16 DetailSaveAdd = 22;

            public const Int16 DETAIL_V = 30;
            public const Int16 DetailUpdate = 31;
            public const Int16 DetailDelete = 32;
            public const Int16 DetailClone = 33;
            public const Int16 DetailReport = 34;

            public const Int16 OTHER = 40;
            public const Int16 DetailReset = 41;    //20, 30
            public const Int16 DetailPreview = 42;  //20, 30
            public const Int16 DetailBack = 43;     //20, 30
            public const Int16 DetailComment = 44;
            public const Int16 DetailPost = 45;

            public const Int16 DEFAULT = 0;
            public const Int16 ACCESS_DENIAL = 99;
        }

        public class TypeReport
        {
            public const Int16 DEFAULT = 0;
            public const Int16 ACCOUNT = 1;
            public const Int16 ORDER = 2;
        }

        public class PublicID
        {
            public const Int16 RESOURCE = 9;
            public const Int16 HOT_DEAL = 8;
            public const Int16 TOPIC = 1;
        }

        public class sCID
        {
            public const String DEFAULT = "NMT";
            public const String HOTDEAL = "HOTDEAL";
            public const String TOPIC = "TOPIC";
            public const String QUESTION_ANSWER = "QUESTION ANSWER";
            public const String RESOURCE = "RESOURCE";
        }

        public class Facebook_HttpMethod
        {
            public const Int16 Get = 0;
            public const Int16 Post = 1;
            public const Int16 Delete = 2;
        }

        public class MaxLength
        {
            public const Int16 _50 = 50;
            public const Int16 _100 = 100;
            public const Int16 _150 = 150;
            public const Int16 _200 = 200;
            public const Int16 _500 = 500;
            public const Int16 _1000 = 1000;
        }

        public class Facebook_Type
        {
            public const Int16 unknown = 0;

            public const Int16 user = 10;

            public const Int16 page = 20;

            public const Int16 group = 30;

            public const Int16 feed = 40;
            public const Int16 status = 41;
            public const Int16 photo = 42;
            public const Int16 video = 43;
            public const Int16 link = 44;
            public const Int16 events = 45;
            public const Int16 offer = 46;
            public const Int16 note = 47;

            public const Int16 like = 50;

            public const Int16 comment = 60;
            public const Int16 reply = 61;

            public const Int16 share = 70;

            public static SortedList Get_Facebook_Type()
            {
                SortedList sl = new SortedList();
                sl.Add(user, "user");
                sl.Add(page, "page");
                sl.Add(group, "group");
                sl.Add(feed, "post (status, photo, video, link, event, offer, note)");
                return sl;
            }

            public static SortedList Get_Facebook_Type_Full()
            {
                SortedList sl = new SortedList();
                sl.Add(unknown, "");
                sl.Add(user, "user");
                sl.Add(page, "page");
                sl.Add(group, "group");
                sl.Add(feed, "feed");
                sl.Add(status, "status");
                sl.Add(photo, "photo");
                sl.Add(video, "video");
                sl.Add(link, "link");
                sl.Add(events, "events");
                sl.Add(offer, "offer");
                sl.Add(note, "note");
                sl.Add(like, "like");
                sl.Add(comment, "comment");
                sl.Add(reply, "reply");
                sl.Add(share, "share");
                return sl;
            }
        }
    }
}
